package types

type User struct {
	BaseModel
	NickName string `json:"nickName" form:"nickName" binding:"required" gorm:"type:varchar(255);comment:用户名;"`
	Account  string `json:"account" form:"account" binding:"required" gorm:"type:varchar(255);comment:账号;"`
	Password string `json:"passWord" form:"passWord" binding:"required" gorm:"type:varchar(255);comment:密码;"`
	Phone    string `json:"phone" form:"phone" binding:"required" gorm:"type:varchar(255);comment:手机号;"`
	Sex      string `json:"sex" form:"sex" binding:"required" gorm:"type:varchar(100);comment:性别;"`
	Uuid     string `json:"uuid"`
	Address  string `json:"address" form:"address" binding:"required" gorm:"type:varchar(255);comment:地址;"`
	Shops    string `json:"shops" form:"shops" binding:"required" gorm:"type:varchar(255);comment:关联店铺;"`
	Auth     int    `json:"auth" gorm:"default:0;comment:权限;"`
	// gorm.Model
}

// Valid implements jwt.Claims.
func (User) Valid() error {
	panic("unimplemented")
}

func (User) TableName() string {
	return "sys_user"
}

type UserListStruct struct {
	PageStrct
	KeyWords string `json:"keywords" form:"keywords"`
}

type UserListResponse struct {
	List  []User `json:"list"`
	Total int64  `json:"total"`
}

type TypeUser struct {
	NickName string `json:"nickName" form:"nickName" binding:"required"`
	Account  string `json:"account" form:"account"`
	Password string `json:"passWord" form:"passWord"`
	Phone    string `json:"phone" form:"phone" binding:"required"`
	Sex      string `json:"sex" form:"sex" binding:"required"`
	Uuid     string `json:"uuid"`
	Address  string `json:"address" form:"address" binding:"required"`
	Shops    string `json:"shops" form:"shops" binding:"required"`
	Auth     int    `json:"auth" gorm:"default:0"`
}
